
package companyadministration;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import model.Pelatis;

public class EditPelatisForm extends javax.swing.JFrame {

    
    public EditPelatisForm(Pelatis p){
        pelatis1=p;
        //εμφανιση στο κεντρο της οθονης
        initComponents();
        // Το παράθυρο ανοίγει στο κέντρο της οθόνης
        setLocationRelativeTo(null);
       }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        pelatis2 = pelatis1;
        jLabel1 = new javax.swing.JLabel();
        jLabel2Kodikos = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4Onoma = new javax.swing.JLabel();
        jLabel5Tilephono1 = new javax.swing.JLabel();
        jLabel6Tilephono2 = new javax.swing.JLabel();
        jLabel7Tilephono3 = new javax.swing.JLabel();
        jLabel8Tilephono4 = new javax.swing.JLabel();
        jLabel9Dieuthinsi = new javax.swing.JLabel();
        jButton1Akiro = new javax.swing.JButton();
        jButton1Apothikeusi = new javax.swing.JButton();
        jTextField1Kodikos = new javax.swing.JTextField();
        jTextField2Eponimo = new javax.swing.JTextField();
        jTextField3Onoma = new javax.swing.JTextField();
        jTextField4Τel1 = new javax.swing.JTextField();
        jTextField5Tel2 = new javax.swing.JTextField();
        jTextField6Tel3 = new javax.swing.JTextField();
        jTextField7Tel4 = new javax.swing.JTextField();
        jTextField8Address = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Εισαγωγη Πελατη");
        setResizable(false);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabel1.setText("ΕΙΣΑΓΩΓΗ ΠΕΛΑΤΗ");

        jLabel2Kodikos.setText("Κωδικός");

        jLabel3.setText("Επωνυμο");

        jLabel4Onoma.setText("Ονομα");

        jLabel5Tilephono1.setText("Τηλεφωνο 1");

        jLabel6Tilephono2.setText("Τηλέφωνο 2");

        jLabel7Tilephono3.setText("Τηλέφωνο 3");

        jLabel8Tilephono4.setText("Τηλέφωνο 4");

        jLabel9Dieuthinsi.setText("Διεύθυνση");

        jButton1Akiro.setText("Ακυρο");
        jButton1Akiro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1AkiroActionPerformed(evt);
            }
        });

        jButton1Apothikeusi.setText("Αποθήκευση");
        jButton1Apothikeusi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ApothikeusiActionPerformed(evt);
            }
        });

        jTextField1Kodikos.setEditable(false);

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${code}"), jTextField1Kodikos, org.jdesktop.beansbinding.BeanProperty.create("text"), "code");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${eponimo}"), jTextField2Eponimo, org.jdesktop.beansbinding.BeanProperty.create("text"), "epwnimo");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${onoma}"), jTextField3Onoma, org.jdesktop.beansbinding.BeanProperty.create("text"), "onoma");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${tel1}"), jTextField4Τel1, org.jdesktop.beansbinding.BeanProperty.create("text"), "tel1");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${tel2}"), jTextField5Tel2, org.jdesktop.beansbinding.BeanProperty.create("text"), "tel2");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${tel3}"), jTextField6Tel3, org.jdesktop.beansbinding.BeanProperty.create("text"), "tel3");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${tel4}"), jTextField7Tel4, org.jdesktop.beansbinding.BeanProperty.create("text"), "tel4");
        bindingGroup.addBinding(binding);

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, pelatis2, org.jdesktop.beansbinding.ELProperty.create("${adress}"), jTextField8Address, org.jdesktop.beansbinding.BeanProperty.create("text"), "address");
        bindingGroup.addBinding(binding);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel9Dieuthinsi)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField8Address, javax.swing.GroupLayout.DEFAULT_SIZE, 290, Short.MAX_VALUE))
                    .addComponent(jLabel1)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jButton1Akiro)
                        .addGap(18, 18, 18)
                        .addComponent(jButton1Apothikeusi))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel8Tilephono4)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField7Tel4))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel5Tilephono1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField4Τel1))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel2Kodikos)
                            .addGap(31, 31, 31)
                            .addComponent(jTextField1Kodikos, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel6Tilephono2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField5Tel2, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel7Tilephono3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jTextField6Tel3)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addGap(26, 26, 26)
                        .addComponent(jTextField2Eponimo, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel4Onoma)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField3Onoma, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(32, 32, 32))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2Kodikos)
                    .addComponent(jTextField1Kodikos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel4Onoma)
                    .addComponent(jTextField2Eponimo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField3Onoma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(16, 16, 16)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5Tilephono1)
                    .addComponent(jTextField4Τel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6Tilephono2)
                    .addComponent(jTextField5Tel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7Tilephono3)
                    .addComponent(jTextField6Tel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8Tilephono4)
                    .addComponent(jTextField7Tel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9Dieuthinsi)
                    .addComponent(jTextField8Address, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1Akiro)
                    .addComponent(jButton1Apothikeusi))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1AkiroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1AkiroActionPerformed
        
        MyWindowEvent we = new MyWindowEvent(this, WindowEvent.WINDOW_CLOSED,false);
        for (WindowListener l : this.getWindowListeners()) {
            l.windowClosed(we);
       }
       this.setVisible(false); 
    }//GEN-LAST:event_jButton1AkiroActionPerformed

    private void jButton1ApothikeusiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ApothikeusiActionPerformed
        // Διαχείριση παραθύρων
        MyWindowEvent we = new MyWindowEvent(this, WindowEvent.WINDOW_CLOSED,true);
        for (WindowListener l : this.getWindowListeners()) {
            l.windowClosed(we);
       }
       this.setVisible(false);  
        
    }//GEN-LAST:event_jButton1ApothikeusiActionPerformed

    /**
     * @param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1Akiro;
    private javax.swing.JButton jButton1Apothikeusi;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2Kodikos;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4Onoma;
    private javax.swing.JLabel jLabel5Tilephono1;
    private javax.swing.JLabel jLabel6Tilephono2;
    private javax.swing.JLabel jLabel7Tilephono3;
    private javax.swing.JLabel jLabel8Tilephono4;
    private javax.swing.JLabel jLabel9Dieuthinsi;
    private javax.swing.JTextField jTextField1Kodikos;
    private javax.swing.JTextField jTextField2Eponimo;
    private javax.swing.JTextField jTextField3Onoma;
    private javax.swing.JTextField jTextField4Τel1;
    private javax.swing.JTextField jTextField5Tel2;
    private javax.swing.JTextField jTextField6Tel3;
    private javax.swing.JTextField jTextField7Tel4;
    private javax.swing.JTextField jTextField8Address;
    private model.Pelatis pelatis2;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

Pelatis pelatis1;
}
